<?php

namespace System\Lib\Twitter\Auth;

/**
 * Description of Customer
 *
 * @author Elton Schivei Costa
 */
class Customer extends \System\Types\Object
{

    private $_key;
    private $_secret;
    private $_callback;

    public function __construct(\System\Types\String $key, \System\Types\String $secret, \System\Types\String $callbackUrl = null)
    {
        parent::__construct();

        $this->_key = $key;
        $this->_secret = $secret;
        $this->_callback = $callbackUrl;
    }

    public function __set($var, $value)
    {
        $$var = $value;
    }

    public function __get($var)
    {
        $field = '_' . lcfirst($var);

        if (isset($this->{$field}))
        {
            return $this->{$field};
        }

        return null;
    }

    public function ToString()
    {
        return "Consumer[key={$this->_key},secret={$this->_secret}]";
    }

}
